<?php
namespace User\Model;
use Think\Model;

class QuestionnaireModel extends Model
{
    CONST QUESTIONNAIRE_ACTIVE = 1;
    CONST QUESTIONNAIRE_PENDING = 2;
    CONST QUESTIONNAIRE_DELETE = 9;

    CONST QUESTION_ACTIVE = 1;
    CONST QUESTION_DELETE = 9;

    CONST ANSWER_ACTIVE = 1;
    CONST ANSWER_DELETE = 9;

    CONST ANSWER_CORRECT = 1;
    CONST ANSWER_WRONG = 9;
    CONST ANSWER_NONE = 0;

    CONST RANDOM_ON = 1;
    CONST RANDOM_OFF = 9;

    CONST ENDING_ACTIVE = 1;
    CONST ENDING_DELETE = 9;

    CONST STATISTICS_ACTIVE = 1;
    CONST STATISTICS_DELETE = 9;

    CONST QUESTION_TYPE_TEXT = 1;
    CONST QUESTION_TYPE_IMAGE = 2;

    CONST QRCODE_MISS = 0;
    CONST QRCODE_ON = 1;
    CONST QRCODE_OFF = 9;

    CONST TYPE_MAIN = 0;          //主干题目
    CONST TYPE_BRANCH = 1;        //分支题目

    CONST MUSIC_OFF = 0;    //关闭背景音乐
    CONST MUSIC_ON = 1;     //打开背景音乐

    CONST EXTRA_OFF = 0;    //关闭自定义回答
    CONST EXTRA_ON = 1;     //打开自定义回答

    public static function getTheme($value = 'all'){
        $theme = [
            '1' => '#8E14B3|#F2479C',
            '2' => '#1A8CD4|#17EAD9',
            '3' => '#3BB2B8|#42E695',
            '4' => '#D63D48|#FFD452'
        ];
        if($value === 'all'){
            return $theme;
        }
        if(array_key_exists($value,$theme)){
            return $theme[$value];
        }
        return '未知';
    }

}
?>